Tweaking Firefox

It’s a big day at the open source camp with the official release of Firefox 1.0. The mozilla web site is just pounded to the ground – it just won’t load like it should, making the downloading of the browser difficult. Bittorrent came in to rescue. The official torrent downloaded fast from the mozilla FTP site, and firefox installation file itself was downloaded in matter of seconds too.

Now, my quest started.

I love keyboard short cuts.

As a web developer, I loved having the Page Info (Tools -> Page Info) at my finger tip. In previous Firefox versions, I could use ctrl-J to access that info. As of version 0.9, ctrl-J was assigned to the Download window, and ctrl-I is the bookmarks (the compatibility issue with Internet Explorer). Installing Pithy extension resolved this problem. So far so good.

There was a period of time when I used Mozilla 1.7 browser. It also is a fine browser. One of the keyboard shortcut I liked was ctrl-Q to shut down Firefox completely. And this shortcut is missing in Firefox. I’ve been wondering if I could add this myself. I should be able to, since the entire user interface of all Mozilla based applications are defined in XUL.

I was just be able to figure this out today. Here is the detail. (And it’s not for the faint at heart)

  1. Find chrome\chrome.rdf file inside Firefox installation folder
  2. Open it in a text editor
  3. Find the section that looks like c:baseURL="jar:resource:/chrome/browser.jar!/content/browser/"
  4. Replace that line with c:baseURL="resource:/chrome/browser/content/browser/"
  5. Find the section that looks like c:baseURL="jar:resource:/chrome/en-US.jar!/locale/browser/"
  6. Replace that line with c:baseURL="resource:/chrome/en-US/locale/browser/"
  7. Save the file, and exit the text editor
  8. Find chrome\browser.jar file inside Firefox folder
  9. Make a copy of the file, and name it browser.zip
  10. Unzip the content of the zip file to browser folder within the current location
  11. Find chrome\en-US.jar file inside Firefox folder
  12. Make a copy of the file, and name it en-US.zip
  13. Unzip the content of the zip file to en-US folder within the current location
  14. Find chrome\browser\content\browser\browser.xul file within the Firefox folder – This is one of the files that was just unzipped
  15. Open the file in a text editor
  16. Find the section that looks like <key id="key_SwitchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_SwitchTextDirection" modifiers="accel,shift" />
  17. Add this line after the previous one : <key id="key_Quit" key="&quitApplicationCmdWin.commandkey;" oncommand="goQuitApplication();" modifiers="accel"/>
  18. Find the section that looks like <menuitem id="menu_FileQuitItem" label="&quitApplicationCmdWin.label;" accesskey="&quitApplicationCmdWin.accesskey;" oncommand="goQuitApplication();"/>
  19. Change that line to <menuitem id="menu_FileQuitItem" label="&quitApplicationCmdWin.label;" accesskey="&quitApplicationCmdWin.accesskey;" oncommand="goQuitApplication();" key="key_Quit"/>
  20. Save the file and exit the text editor
  21. Find chrome\en-US\locale\browser\browser.dtd file within the Firefox folder – This is another one of the file that was just unzipped
  22. Find the section that looks like <!ENTITY quitApplicationCmdWin.accesskey "x">
  23. Add this line right below that <!ENTITY quitApplicationCmdWin.commandkey "q">
  24. Save the file and exit the text editor
  25. Close Firefox once, and re-run it

The newly created keyboard shortcut doesn’t show up in the menu unlike other shortcut with this method. I’m still looking for that tweak. But now I can quit the browser with ease when I need to.

Comments are closed.